using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.ComponentModel;

namespace Mdv.wssAddins.wss
{
    public class wssForms : Model
    {
        #region Non-Designer Properties
        private List<wssForm> _forms;
        [Browsable(false)]
        public List<wssForm> Forms
        {
            get { return _forms; }
        }
        #endregion
        public override string ToString()
        {
            return "Forms";
        }
        public override void ConstructMap()
        {
        }
        public override void LoadChildren(XmlNode node)
        {
            foreach (XmlNode xn in node.ChildNodes)
            {
                switch (xn.Name)
                {
                    case "Form":
                        wssForm form = new wssForm();
                        form.Load(xn);
                        Children.Add(form);
                        break;
                }
            }
        }
        public wssForms()
        {
            Actions = new List<Action>();
            Actions.Add(new Action("Add Form", this.AddForm));
            Actions.Add(new Action("Delete", this.Delete));
        }
        public void AddForm(ModelEventArgs e)
        {
            NodeAdded(new wssForm(), "Form");
        }
        public void Delete(ModelEventArgs e)
        {
            NodeDeleted("Forms");
        }
    }
}